/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.wfaces.mb;

import com.wfaces.dao.Dao;
import com.wfaces.entities.User;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author lhoussin
 */
@ManagedBean
@SessionScoped
public class UsersMB {

    /**
     * Creates a new instance of UsersMB
     */
    User user;
    String passwordConf;
    Dao dao = new Dao();

    public UsersMB() {
        user = new User();
    }

    
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public String getPasswordConf() {
        return passwordConf;
    }

    public void setPasswordConf(String passwordConf) {
        this.passwordConf = passwordConf;
    }

    public void signUp() {

        if (this.passwordConf.equals(user.getPassword())) {
            dao.begin();
            dao.create(user);
            dao.commit();
        }
    }
    
    public static void main(String args[]) {
        
    }
}
